package mango.orm;

import java.sql.ResultSet;
import java.sql.Statement;
import java.util.List;

import mango.orm.connect.Connector;
import mango.orm.entity.Entity;




public interface DBSession {

    public Connector getConnector();
    
    public String getConnectorName();

    public Dao query(String sql);

    public Dao query(Class<? extends Entity> bc, String sql);

    public Dao query(Entity entity);

    public void save(Entity entity);

    public void save(List<? extends Entity> entitys);

    public void update(Entity entity);

    public void saveOrUpdate(Entity entity);

    public void delete(Entity entity);

    public void update(String sql);
    
    public void update(String sql, Object... parameters);
    
    public void execute(String sql);
    
    public void execute(String sql, Object... parameters);
    
    public void addStatement(Statement stat);
    
    public void addResultSet(ResultSet retSet);

    public void close();

    public boolean isClosed();

    public void commit();
    
    public void rollback();

    public void saveIfNotExists(Entity entity);
}
